#include <gtest/gtest.h>
#include "core/reader/json_reader.h"

using namespace aliyun;

TEST(core_reader, JsonReader) {
  const char *json_body =
    "{"
    " \"RequestId\": \"04F0F334-1335-436C-A1D7-6C044FE73368\", "
    " \"InstanceId\": \"i-instance1\" "
    "}";
  JsonReader json_reader;
  std::map<string, string> response_map;
  json_reader.Parse(json_body, strlen(json_body), "Test",response_map);
  ASSERT_STREQ("04F0F334-1335-436C-A1D7-6C044FE73368", response_map["Test.RequestId"].c_str());
  ASSERT_STREQ("i-instance1", response_map["Test.InstanceId"].c_str());

}

// end of file
